package com.uchedao.seller.ui.carlist;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

/**
 * Created by ZhangZhanghua on 2015/10/28 0028.
 */
public abstract class BaseActivity extends FragmentActivity {

    /**
     * 页面标签
     */
    protected String TAG = "BaseActivity";

    /**
     * 设置页面标签
     */
    protected abstract String getActivityTag();

    /**
     * 获取布局XML ID
     */
    protected abstract int getLayoutResID();

    /**
     * 初始化控件
     */
    protected abstract void initView();

    /**
     * 初始化数据
     */
    protected abstract void initData();

    /**
     * 初始化监听事件
     */
    protected abstract void initListener();

    protected void onSetting() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        onSetting();
        setContentView(getLayoutResID());
        TAG = getActivityTag();
        init();
    }

    protected void init() {
        initView();
        initData();
        initListener();
    }
}
